// import com.alibaba.druid.sql.ast.SQLExpr;
// import com.alibaba.druid.sql.ast.SQLName_ptr;
// import com.alibaba.druid.sql.ast.SQLObject;
// import com.alibaba.druid.sql.dialect.oracle.ast.OracleSQLObjectImpl;
// import com.alibaba.druid.sql.dialect.oracle.visitor.OracleASTVisitor;

// import java.util.ArrayList;
// import java.util.List;

#include "OracleAlterTableSplitPartition.h"
#include "../../../../ast/SQLExpr.h"
#include "../../../../ast/SQLName.h"
#include "../../../../ast/SQLObject.h"
#include "../../visitor/OracleASTVisitor.h"
#include "../../../../../utils/listTran.h"

OracleAlterTableSplitPartition_NestedTablePartitionSpec::OracleAlterTableSplitPartition_NestedTablePartitionSpec()
{
  segmentAttributeItems = std::make_shared<std::list<SQLObject_ptr>>();
}
// @Override
void OracleAlterTableSplitPartition_NestedTablePartitionSpec::accept0(OracleASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(OracleAlterTableSplitPartition_NestedTablePartitionSpec)))
  {
    acceptChild(visitor, partition);
    acceptChild(visitor, segmentAttributeItems);
  }
  visitor->endVisit(SharedObject(OracleAlterTableSplitPartition_NestedTablePartitionSpec));
}

SQLName_ptr OracleAlterTableSplitPartition_NestedTablePartitionSpec::getPartition()
{
  return partition;
}

void OracleAlterTableSplitPartition_NestedTablePartitionSpec::setPartition(SQLName_ptr partition)
{
  this->partition = partition;
}

SQLObject_list_ptr OracleAlterTableSplitPartition_NestedTablePartitionSpec::getSegmentAttributeItems()
{
  return segmentAttributeItems;
}

void OracleAlterTableSplitPartition_NestedTablePartitionSpec::setSegmentAttributeItems(SQLObject_list_ptr segmentAttributeItems)
{
  this->segmentAttributeItems = segmentAttributeItems;
}

OracleAlterTableSplitPartition_TableSpaceItem::OracleAlterTableSplitPartition_TableSpaceItem()
{
}

OracleAlterTableSplitPartition_TableSpaceItem::OracleAlterTableSplitPartition_TableSpaceItem(SQLName_ptr tablespace)
{
  this->tablespace = tablespace;
}

// @Override
void OracleAlterTableSplitPartition_TableSpaceItem::accept0(OracleASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(OracleAlterTableSplitPartition_TableSpaceItem)))
  {
    acceptChild(visitor, tablespace);
  }
  visitor->endVisit(SharedObject(OracleAlterTableSplitPartition_TableSpaceItem));
}

SQLName_ptr OracleAlterTableSplitPartition_TableSpaceItem::getTablespace()
{
  return tablespace;
}

void OracleAlterTableSplitPartition_TableSpaceItem::setTablespace(SQLName_ptr tablespace)
{
  this->tablespace = tablespace;
}

OracleAlterTableSplitPartition_UpdateIndexesClause::OracleAlterTableSplitPartition_UpdateIndexesClause()
{
  items = std::make_shared<std::list<SQLObject_ptr>>();
}
// @Override
void OracleAlterTableSplitPartition_UpdateIndexesClause::accept0(OracleASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(OracleAlterTableSplitPartition_UpdateIndexesClause)))
  {
    acceptChild(visitor, items);
  }
  visitor->endVisit(SharedObject(OracleAlterTableSplitPartition_UpdateIndexesClause));
}

SQLObject_list_ptr OracleAlterTableSplitPartition_UpdateIndexesClause::getItems()
{
  return items;
}

void OracleAlterTableSplitPartition_UpdateIndexesClause::setItems(SQLObject_list_ptr items)
{
  this->items = items;
}

OracleAlterTableSplitPartition::OracleAlterTableSplitPartition()
{
  at = std::make_shared<std::list<SQLExpr_ptr>>();
  values = std::make_shared<std::list<SQLExpr_ptr>>();
  into = std::make_shared<std::list<OracleAlterTableSplitPartition_NestedTablePartitionSpec_ptr>>();
}
// @Override
void OracleAlterTableSplitPartition::accept0(OracleASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(OracleAlterTableSplitPartition)))
  {
    acceptChild(visitor, name);
    SQLObject_list_ptr tmp1 = ListTran::tran_class<SQLExpr, SQLObject>(at);
    acceptChild(visitor, tmp1);
    SQLObject_list_ptr tmp2 = ListTran::tran_class<SQLExpr, SQLObject>(values);
    acceptChild(visitor, tmp2);
    acceptChild(visitor, updateIndexes);
  }
  visitor->endVisit(SharedObject(OracleAlterTableSplitPartition));
}

OracleAlterTableSplitPartition_UpdateIndexesClause_ptr OracleAlterTableSplitPartition::getUpdateIndexes()
{
  return updateIndexes;
}

void OracleAlterTableSplitPartition::setUpdateIndexes(OracleAlterTableSplitPartition_UpdateIndexesClause_ptr updateIndexes)
{
  this->updateIndexes = updateIndexes;
}

SQLName_ptr OracleAlterTableSplitPartition::getName()
{
  return name;
}

void OracleAlterTableSplitPartition::setName(SQLName_ptr name)
{
  this->name = name;
}

SQLExpr_list_ptr OracleAlterTableSplitPartition::getAt()
{
  return at;
}

void OracleAlterTableSplitPartition::setAt(SQLExpr_list_ptr at)
{
  this->at = at;
}

OracleAlterTableSplitPartition_NestedTablePartitionSpec_list_ptr OracleAlterTableSplitPartition::getInto()
{
  return into;
}

void OracleAlterTableSplitPartition::setInto(OracleAlterTableSplitPartition_NestedTablePartitionSpec_list_ptr into)
{
  this->into = into;
}

SQLExpr_list_ptr OracleAlterTableSplitPartition::getValues()
{
  return values;
}

void OracleAlterTableSplitPartition::setValues(SQLExpr_list_ptr values)
{
  this->values = values;
}
